import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter)
import Home from './components/home'
import Hello from './components/Hello'
import Test from './components/test'
const routes = [{
    path: '/',
    component: Home,
    children: [{
            path: '/test',
            component: Test
        },

        {
            path: '/hello',
            component: Hello
        },
        {
            path: '*',
            redirect: '/hello'
        },
    ]
}]
const router = new VueRouter({
    mode: 'hash',
    routes: routes, // short for routes: routes
    linkActiveClass: 'active', //router-link的选中状态的class，也有一个默认的值
    history: true,
    canReuse: false,
});
export default router